The present invention generally relates to computer processing and more specifically to instruction scheduling using a cost function.
Instruction scheduling involves assigning operations from an original sequence of operations to specific functional units at specific times in a way to make efficient use of hardware resources. The scheduled operations produce the same result as executing the operations sequentially in an original order but the operations may not be scheduled in that original order. The goal is to efficiently use hardware resources and retain the original result that would be obtained by executing the operations sequentially.
Instruction scheduling operates by scheduling an instruction that is executed for each clock cycle of a processor. Each instruction includes a slot for each functional unit of the processor where an operation may be scheduled. The instruction scheduler then schedules operations for functional units during a clock cycle. Typically, instruction schedulers attempt to schedule operations where a minimum number of instructions are used and operations are scheduled for as many functional units as possible in each instruction used.
The process of instruction scheduling orders operations in a scheduling order list, which is typically a list of operations in the order the operations should be executed if they were executed sequentially. Starting from the first ordered operation, the instruction scheduler determines the first functional unit earliest in time that may be able to execute the operation. When the first functional unit is found, the instruction scheduler schedules the instruction for that functional unit at that time. This process is repeated sequentially for each operation in the list.
The above approach may work when scheduling a small amount of functional units. However, when a large amount of functional units need to be scheduled for a given instruction or clock cycle, problems with the schedule result. For example, a resulting schedule may introduce delays in executing the operations, produce resource contention, and inefficiently use the resources.
Also, in one example, a resulting schedule is likely to result in excessive movement of data among function units. The excessive movement may result in delays in the execution of operations due to exhaustion of resources for data movement. The delays then increase the need for temporary data storage, which possibly exhausts data storage resources. In addition, the excessive data movement requires more time and power. Thus, the resulting schedule produces delays, uses resources inefficiently, and requires more power.